package dao;

import java.util.HashMap;
import java.util.Set;

/**
 * Interface EmailDao
 * 
 * Class using this interface must implement the methods in this interface. This
 * class contains methods to perform dao operations
 * @author Sukhjinder 
 * @since May 2013
 * @version $Revision: 1.0 $
 */
public interface EmailDao {

	/**
     * Creates a new email entry and returns the ID
     * @param properties 
    
     * @return int
	 * @throws DaoException
	 * @throws ModelException  */
    public int create(HashMap<String, String> properties) throws DaoException;
    
    /**
     * Loads a email row for given ID
    
    
    
     * @param Id int
     * @return HashMap<String,String>
     * @throws DaoException
     * @throws ModelException  */
    public HashMap<String, String> load(int Id) throws DaoException;
    
    /**
     * Updates an email row
     * @param properties
    
     * @throws DaoException
     * @throws ModelException  */
    public void update(HashMap<String, String> properties) throws DaoException;
    
    /**
	 * Deletes an email row, given the id
	
	
	 * @param Id int
     * @throws DaoException
     * @throws ModelException  */
	public void delete(int Id) throws DaoException;
	
	/**
	 * given the folderId, returns all the emails
	 * 
	 * @param folderId
	
	
	 * @return properties * @throws DaoException */
	public HashMap<Integer, String[]> findByFolderId(int folderId) throws DaoException;
	
	/**
	 * Given the folder id, deletes all the emails
	
	
	 * @param folderId int
	 * @throws DaoException
	 * @throws ModelException  */
	public void deleteByFolderId(int folderId) throws DaoException;
	
	/**
	 * Given the array of email ids, deletes them
	 * @param emailIds Set of email ids
	
	 * @throws DaoException  */
	public void deleteById(Set<Integer> emailIds) throws DaoException;
	
	/**
	 * Given the array of email ids, updates their folder id
	 * @param emailIds Set of email ids
	 * @param folderId New folder Id
	
	 * @throws DaoException */
	public void updateFolderId(Set<Integer> emailIds, int folderId) throws DaoException;
	
	
}
